-
Notifications
You must be signed in to change notification settings - Fork 54
Update MCP Server to allow for meta, structuredContent and OpenAI Apps
#99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update MCP Server to allow for meta, structuredContent and OpenAI Apps
#99
Conversation
|
Thanks for the PR really solid work. Tests are failing, but could you split this into smaller parts? For example:
That way, it’ll be much easier to review and merge this feature faster. |
Done! I broke them up a bit differently, but hopefully it's easier to reason with.
This can be closed, if you'd like! |
(resubmitting this from a branch, prev: #95)
This PR aims to tackle a few missing pieces from the MCP Spec, specifically adding meta info to Primitive output, as well as Response output. This is only an initial take on it, if it looks like a good path forward, I'll be happy to continue to refine.
It also includes a complete way to setup the structure for a ChatGPT app, following their SDK specs.
On Primitives Meta:
A new property for
$metawas added, which will allow you to attach the_metaoutput property. Currently, this has only been applied to the Tool output, but may be added to other Primitives. This behaves in the same way that$name,$titleor$descriptionwould. A new method forsecuritySchemes()has also been added to tools, which works in a similar fashion to the JSONschema()method.Example:
On Tool Response Meta:
A few new fluent methods have been added to the
text()response type formeta()andstructuredContent(). These are then read in theCallToolmethod and returned in the response, if they're available.Example:
On OpenAI/ChatGPT Apps
A new Response method has been added called
app(), to be used in Resource primitives for returning the required data to a ChatGPT app.Example:
Tip
$appincludes some helpers for ChatGPT apps, but also includes ameta()method to allow adding additional items to the metadata responseSummary
This has handled all edge cases for me, in testing locally. The only thing I'm unsure of is if things like Prompts would ever need meta on the primitive level, or on the content level. That can be adjusted very easily, though.
On the topic of ChatGPT Apps, I've also got a fully working app setup, with a separate build process for widgets, that has worked very well, with these changes to the Laravel MCP package. I'd be happy to share it as well -- again, if this is something that looks worthy of moving forward with!
Closes #78